import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter as Router, Routes, Route, Navigate} from 'react-router-dom';
import {PersistGate} from 'redux-persist/integration/react';
import {persistor} from './store';
import {ConfigProvider} from 'antd';
import zhCN from 'antd/es/locale/zh_CN'
import 'antd/dist/antd.less';
import './base.scss';
import './common.scss';

import Login from "./pages/login";
import City from "./pages/city";
import Building from "./pages/Building";
// import BuildingEdit from "./pages/Building/edit";
import House from "./pages/House";
// import HouseEdit from "./pages/House/edit";
import Client from "./pages/client";
import Key from "./pages/key";
import Store from "./pages/store";
import Auth from "./pages/auth";
// 系统设置
import Setting from './pages/Setting'

ReactDOM.render(
    <ConfigProvider locale={zhCN}>
        <PersistGate loading={null} persistor={persistor}>
            <Router>
                <Routes>
                    <Route path="login" element={<Login/>} />
                    <Route path="city" element={<City/>} />
                    <Route path="building" element={<Building/>} />
                    {/*<Route path="building-edit" element={<BuildingEdit/>} >*/}
                        {/*<Route path=":id">*/}
                        {/*    <Route path=":tab"/>*/}
                        {/*</Route>*/}
                    {/*</Route>*/}
                    <Route path="house" element={<House/>} />
                    {/*<Route path="house-edit" element={<HouseEdit/>} >*/}
                        {/*<Route path=":id" />*/}
                    {/*</Route>*/}
                    <Route path="client" element={<Client/>} />
                    <Route path="key" element={<Key/>} />
                    <Route path="store" element={<Store/>} />
                    {/* <Route path="organization" element={<Organization/>} /> */}
                    <Route path="auth" element={<Auth/>} />
                    <Route path="system_set" element={<Setting/>}/>
                    <Route path="*" element={<Navigate to="/city" />} />
                </Routes>
            </Router>
        </PersistGate>
    </ConfigProvider>,
    document.getElementById('root')
);
